package com.baozun.houji.goods.adapter

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.baozun.houji.goods.fragment.CategoryFragment

/**
 * @Title：首页分类页面viewpager适配器
 * @Description：
 * @Author：xing.luo
 * @Since：2022/11/09
 * @Version：1.0.0
 */
class CategoryPageListAdapter(activity: Fragment, val fragment: MutableList<CategoryFragment>) : FragmentStateAdapter(activity) {

    override fun getItemCount(): Int {
        return fragment.size
    }

    override fun createFragment(position: Int): Fragment {
        return fragment[position]
    }
}